package excercise.Page30;

/**
 * @Author: Miyako
 * @Date: 2024-07-17-8:53
 * @Description: 前进，撤退，attack 方法
 */
public class Soldier {
    int id ;
    int Hp =100;
    Ak47 a;
    boolean bat = false;
    void goBat(){
        bat=true;
        System.out.println("上");
    }
    void backBat(){
        bat=false;
    }
    void attack(Soldier enemy){
        if (!(this.bat&&enemy.bat)){
            System.out.println("不可选中");
            return;
        }
        a.fire();

    }

}
